package com.design.alex.proxy;

/**
 * @ClassName : ProxyImage
 * @Description : todo
 * @Author : Alex
 * @Date: 2020-02-17 17:58
 */
public class ProxyImage implements Image {
    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if (realImage == null) {
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}
